// ************************************************************* //
//                                                               //
//        Copyright (C) 2015 by Socionext Inc.                   //
//        All rights reserved.                                   //
//        Socionext Inc. Proprietary and Confidential.           //
//                                                               //
// ************************************************************* //
/*****************************************************************************/
/**
* @file em_data.c
* @brief eMMC data
* @note None
* @attention None
*
*/
/*****************************************************************************/

// include -------------------------------------
#include "em_data.h"
#include "em_int_cmn.h"

#undef FILEID
#define FILEID FILE_EM_DATA

/**
 *
 */

/// Host informatoin
volatile EM_HOST sHosts __attribute__((aligned(32)));

/// ADMA descriptor area
volatile char sc_descriptor_area[ EM_CONFIG_MAX_DESCR_BUFF_SIZE * EM_CONFIG_SLOT_COUNT ] __attribute__((aligned(32)));

/// eMMC error trace area
// T_TRACE g_sTracedata __attribute__((aligned(32)));
/// RCA address for RCA cards for MMC cards
volatile unsigned short us_gRCA __attribute__((aligned(32))) = 1;
/// Access mode
volatile EM_ACCESS_MODE e_gAccessMode __attribute__((aligned(32))) = EM_ACCESS_MODE_HS_SDR;
volatile EM_PARTITION_ACCESS e_gAccessPrttition __attribute__((aligned(32))) = EM_ACCCESS_BOOT_NONE;


#if 0
/*****************************************************************************/
/**
 * @brief eMMC clear error trace aera
 * @param[in] p_trace eMMC
 * @return None
 */
/*****************************************************************************/
void em_clearTraceInfo(
	T_TRACE* p_trace
){
	int iCnt = 0;
	
	if( p_trace == NULL ) {
		return ;
	}

	p_trace->factor = 0;
	for(iCnt = 0; iCnt<sizeof(p_trace->info); iCnt++) {
		p_trace->info[ iCnt ] = 0;
	}
}
#endif
